package Cy.Servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Cy.DAO.ReceivingDAO;
import Entity.Orders;
import Factory.ReceivingFactory;

/**
 * Servlet implementation class addreceivingzhongzhuanServlet
 */
@WebServlet("/addreceivingzhongzhuan")
public class addreceivingzhongzhuanServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private ReceivingDAO receivingDAO = ReceivingFactory.createDAO();
	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		int oid = Integer.parseInt(request.getParameter("oid"));
		List<Orders> list = receivingDAO.selectaddreceiving1(oid);
		request.setAttribute("list", list);
		request.setAttribute("oid", oid);
		request.getRequestDispatcher("addReceivingzhongzhuan.jsp").forward(request, response);
	}

}
